<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹出框</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        h3{
            height: 90px;
            background-color: red;
        }
        img{
            margin-top: 2000px;
        }
        p{
            margin-top: 2000px;
        }
        .demo_1{
            width: 400px;
            height: 300px;
            background-color: yellow;
            position: fixed;
            top: 50%;
            left: 50%;
            margin-left: -200px;
            margin-top: -150px;
            z-index: 101;
        }
        .demo h4{
            background-color: green;
        }
        .demo_2{
            width: 100%;
            height: 100%;
            background-color: black;
            position: fixed;
            top: 0px;
            left: 0px;
            z-index: 100;
            opacity: 0.5;
        }

    </style>
</head>
<body>
    <h3>导航</h3>
    <div class="demo">
        <div class="demo_1">
            <h4>标题</h4>
        </div>
        <!-- 遮罩层 -->
        <div class="demo_2"></div>
    </div>
    <img src="img/hnkz.jpg" >
    <p>这是一段话</p>
    <img src="img/hnkz1.png" alt="">

</body>
<html>
